package com.ethan.orika;

import com.ethan.model.Person;
import com.ethan.model.PersonDto;
import com.google.common.collect.Lists;
import ma.glasnost.orika.MapperFactory;

import java.util.List;

/**
 * @author ethan
 * create 2018-04-18 下午1:57
 * desc
 **/
public class OrikaTest7 {
    public static void main(String[] args){
        List<Person> list = Lists.newArrayList();
        for (int i = 0; i < 100; i++) {
            Person person = new Person();
            person.setId(i);
        }

        for (Person item: list) {
            MapperFactory mapperFactory  =MapperFactoryHolder.mapperFactory;
            PersonDto personDto = mapperFactory.getMapperFacade().map(item,PersonDto.class);
            System.out.println("personDto:"+personDto.toString());
            System.out.println(mapperFactory.toString());
        }
    }
}
